package com.plian.system.controller.sys.per;
import com.plian.Tools.base.BaseController;
import com.plian.Tools.pagedata.PageData;
import com.plian.system.model.ListResult;
import com.plian.system.model.ObjResult;
import com.plian.system.service.sys.per.FunGroupService;
import com.plian.system.vo.sys.fun.SysFunVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 权限组-权限
 */
@RestController
@RequestMapping(value = "api/funGroup")
public class FunGroupController extends BaseController {
    @Autowired
    FunGroupService funGroupService;


   /**
     * 配置权限组-权限
     */
    @PostMapping(value = "/config")
    public ObjResult funGroupConfig(@RequestBody PageData pd) throws Exception {
        return funGroupService.PerGroupconfig(pd);
    }
    /**
     * 根据权限组id查询有权限的单位
     * @param pd
     * @throws Exception
     * @return
     */
    @PostMapping(value = "/queryfunGroup")
    public ListResult<SysFunVO> queryFunGroup(@RequestBody PageData pd) throws Exception {
        return funGroupService.queryFunGroup(pd);
    }
}
